import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Storage } from '@ionic/storage';
import { ViewController } from 'ionic-angular';
import { GlobalData } from "../../providers/GlobalData";
import { ApiService } from "../../providers/services.api";
import { HelperService } from "../../providers/services.helper";

/**
 * Generated class for the OrderHistoryPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
  selector: 'page-order-history',
  templateUrl: 'order-history.html',
})
export class OrderHistoryPage {

  invoiceList: Array<any>;

  constructor(public navCtrl: NavController,
    public navParams: NavParams,
    private storage: Storage,
    public api: ApiService,
    private helperService: HelperService,
    public viewCtrl: ViewController,
    public global: GlobalData) {

    // sample code
    this.invoiceList = [
      {
        customerName: 'Lawrence Phi',
        invoiceDate: '2016-12-02 14:30 PM',
        customerClass: 'VIP',
        invoiceNo: '#GG-16121082',
        subTotal: 788
      },
      {
        customerName: 'Lawrence Phi',
        date: '2016-12-02 14:30 PM',
        customerClass: 'Standard',
        invoiceNo: '#GG-16121082',
        subTotal: 788
      }
    ];
  }

  
  loadOrderHistory(mode, doer, keyword) {
    
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad OrderHistoryPage');
  }

  // dismiss table list modal
  dismiss() {
    this.viewCtrl.dismiss();
  }

  // open detail
  openDetail(invoice) {
  }

}
